//
//  ACEStudyViewController.m
//  ACE
//
//  Created by zhangtao on 2018/8/7.
//  Copyright © 2018年 zt.td. All rights reserved.
//

#import "ACEStudyViewController.h"
#import "ACEStudyTableViewCell.h"
#import "ACEStudyTable.h"
#import "ACEStudyTopView.h"
#import "ACEConfirmOrderViewController.h"
#import "ACECourseDetailController.h"
#import "ACECourseDetailsViewController.h"
#define STATE_VIEW_HEIGHT 60
@interface ACEStudyViewController ()<StudyActionDelegate>
@end

@implementation ACEStudyViewController
{
    ACEStudyTable *table;
    NSMutableArray *dataArray;
}

-(ACEStudyTable *)table{
    if (!table) {
      table =  [[ACEStudyTable alloc]initWithFrame:CGRectMake(0, STATE_VIEW_HEIGHT+navHeight, ACEWidth, self.view.frame.size.height-STATE_VIEW_HEIGHT-navHeight-tabBarHeight) style:UITableViewStyleGrouped];
        table.StudyDelegate = self;
    table.actionName = @"确  认  结  束";
    table.actionBgColor = MAIN_COLOR();
        table.separatorStyle = UITableViewCellSeparatorStyleNone;
        [table registerNib:[UINib nibWithNibName:@"ACEStudyTableViewCell" bundle:nil] forCellReuseIdentifier:@"cell"];
    }
    return table;
}


- (void)viewDidLoad {
    [super viewDidLoad];
    ACEStudyTopView *topView = [[ACEStudyTopView alloc]initWithFrame:CGRectMake(15, navHeight, ACEWidth-30, STATE_VIEW_HEIGHT)];
    [self.view addSubview:topView];
    [self.view addSubview:self.table];
    [self showLeftHome];

}

#pragma mark ----StudyActionDelegate----
-(void)actionClickWithIndex:(NSIndexPath *)indexPath{
    ACEConfirmOrderViewController *order = [[ACEConfirmOrderViewController alloc]init];
    order.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:order animated:YES];
}

-(void)selectIndex:(NSIndexPath *)indexPath{
#warning 临时跳转
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
    ACECourseDetailsViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"ACECourseDetailsViewController"];
    self.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:vc animated:YES];
//    ACECourseDetailController *detail = [[ACECourseDetailController alloc]init];
//    [self.navigationController pushViewController:detail animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
